-- Decompiled with the Synapse X Luau decompiler.

local ClientOHOH = _G.ClientOHOH;
local CallBackManager = ClientOHOH.load.CallBackManager();
local M = ClientOHOH.class.new(script, ClientOHOH.files.CharacterObject());
local ColliderGroup = ClientOHOH.load.ColliderGroup();
local ColliderManager = ClientOHOH.load.ColliderManager();
local game_cfg = ClientOHOH.config.Game
local CommonOHOH = _G.CommonOHOH;
local HumanoidDescription=game_cfg.FriendHumanoidDescription
local Client_AudioManager = ClientOHOH.load.Client_AudioManager();
local PlayerInfoHelper=_G.ClientOHOH.load.PlayerInfoHelper()
local LanguageHelper=_G.LanguageHelper 

function M.new(self, ...)
	return M(self, ...);
end;

function M.ctor(self,userId,model,cfg,w)
    assert(model,"Path==NULL!")
	M.super.ctor(self, model);
    ColliderManager:SetAllGroup(self.main_inst, ColliderGroup.NoCollider);
    self.WeldConstraint=w
    self.UserId=userId
    self.Cfg=cfg
    local att=Instance.new("Attachment",self.main_inst.Head)
    att.Position=Vector3.new(0,2,0)
    local ui= ClientOHOH:GetPath_Loop("WakeGui",game.ReplicatedStorage.Resource.UI):Clone()
    ui.Parent=att
    self.NameLable= ClientOHOH:GetPath_Loop("Frame.name.num",ui)
    self.PowerLable= ClientOHOH:GetPath_Loop("Frame.power.num",ui)

    local description = self.humanoid:GetAppliedDescription()
	for k,v in pairs(HumanoidDescription) do
		description[k]=v
	end
    self.humanoid.DisplayDistanceType=Enum.HumanoidDisplayDistanceType.None
	self.humanoid:ApplyDescription(description)
    PlayerInfoHelper.GetPlayerInfo(self.UserId,function(head,name)
        if name then
            self.NameLable.Text=name 
        end
    end)

   
end;

local BigNumberHelper = ClientOHOH.load.BigNumberHelper();

function M.Update(self,count)
    -- count/self.Cfg.
   
    local wake=math.floor(count/self.Cfg.needSave)
    local power=0
    for k,v in pairs(self.Cfg.saveReward) do
        power=v
    end
    power=power*wake
    self.PowerLable.Text= LanguageHelper:GetText(30023,{"%%ARG1","%%ARG2"},{wake,BigNumberHelper:ToString(power)})
   
end

function M.dtor(self)
    local obj=self.main_inst
	M.super.dtor(self);
    obj:Destroy()
end;




return M;
